package com.qingge.springboot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qingge.springboot.entity.ExamPaper;
import com.qingge.springboot.mapper.ExamPaperMapper;
import com.qingge.springboot.service.IExamPaperService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 黎俊
 * @since 2022-06-14
 */
@Service
public class ExamPaperServiceImpl extends ServiceImpl<ExamPaperMapper, ExamPaper> implements IExamPaperService {

    @Override
    public void addPaper(ExamPaper examPaper) {
        //先删除本考卷在新增进去
        remove(new QueryWrapper<ExamPaper>().eq("exam_id",examPaper.getPaperId()));
        save(examPaper);
    }
}
